load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")
load("@fbsource//tools/build_defs:rust_linkable_symbol.bzl", "rust_linkable_symbol")

oncall("build_infra")

rust_library(
    name = "buck2_forkserver",
    srcs = glob(
        ["src/**/*.rs"],
    ),
    compatible_with = [
        "ovr_config//os:linux",
        "ovr_config//os:macos",
    ],
    os_deps = [
        (
            "linux",
            [
                ":buck2_miniperf_data",
            ],
        ),
    ],
    deps = [
        "fbsource//third-party/rust:arc-swap",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:libc",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tokio-stream",
        "fbsource//third-party/rust:tonic-0-12-3",
        "//buck2/allocative/allocative:allocative",
        "//buck2/app/buck2_common:buck2_common",
        "//buck2/app/buck2_core:buck2_core",
        "//buck2/app/buck2_error:buck2_error",
        "//buck2/app/buck2_execute_local:buck2_execute_local",
        "//buck2/app/buck2_forkserver_proto:buck2_forkserver_proto",
        "//buck2/app/buck2_fs:buck2_fs",
        "//buck2/app/buck2_grpc:buck2_grpc",
        "//buck2/app/buck2_resource_control:buck2_resource_control",
        "//buck2/app/buck2_util:buck2_util",
        "//buck2/gazebo/dupe:dupe",
    ],
)

rust_linkable_symbol(
    name = "buck2_miniperf_data",
    content_bytes = "//buck2/app/buck2_miniperf:buck2_miniperf",
)
